<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Delicious posting window</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://t.rc.vc/delicious/js/jquery.autocomplete.min.js"></script>

<style type="text/css" media="screen">
body, html {
	margin:0;
	padding:0;
	font-size:12px;	
	font-family:Arial, Helvetica, sans-serif;
	overflow:hidden;
}

table td {
	padding:3px 0;
}

.ac_results ul {
	max-height:135px !important;
}
</style>

<script type="text/javascript">
<?php
// Include the tag generator
include "lib/tags.inc.php";
?>

$(document).ready(function(){

   $("#delicious_tags").autocomplete(delicious_tagsavail, {
      minChars: 0,
      //max:7,
      matchContains: true,
      autoFill: false,
      width:218,
      mustMatch:false,
      multiple:true,
      multipleSeparator:","
   });

   $('#delicious_tags').result(function(event, data, formatted) {

      if( !data ) {
         $(this).removeClass("match");
         $(this).addClass("nomatch");
      } else {
         $(this).removeClass("nomatch");
         $(this).addClass("match");
      }
      $('#result').html( !data ? "The tag you have entered is new in our cloud" : "");
   }).blur(function(){
      if($(this).val().length > 0) {
         $(this).search();
      }
   });


	$("input[type='text']").bind("mouseover focus", function() {
		
		var id = $(this).attr("id");
		if( id == "delicious_url" ) {
			$("#result").html( "The URL you want to bookmark goes here.");
		} else if( id == "delicious_title" ) {
			$("#result").html( "Add a title for the link.");
		} else if( id == "delicious_notes" ) {
			$("#result").html( "Add a longer description for the link here.");
		} else if( id == "delicious_tags" ) {
			$("#result").html( "Add tags for the link, seperated by a comma.");
		} else if( id == "delicious_tweet" ) {
			$("#result").html( "Add an optional tweet here, omitting it means no tweet will be sent.");
		}
												
	});
	
	$("input[type='text']").bind("mouseout", function() {										   
		$("#result").html( "" );
	});

   $("#delicious_submit").bind("click", function() {
      $("form#delicious_emisubmit").submit();
   });

});
</script>
</head>

<body onLoad="document.forms.delicious_emisubmit.delicious_tags.focus();">
<form method="get" action="http://t.rc.vc/delicious/post.php" id="delicious_emisubmit">
<input type="hidden" name="delicious_username" value="<?php echo $_GET["username"]; ?>">
<input type="hidden" name="delicious_password" value="<?php echo $_GET["password"]; ?>">
<div style="padding-bottom:15px;padding-left:10px;color:#000;"><small>another <a style="color:#000;" href="http://nilicule.com">nilicule</a> project</small></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="background:#fff">
  <tr>
    <td>URL:</td>
    <td>
      <input type="text" id="delicious_url" name="delicious_url" style="width:218px;" value="<?php echo $_GET["url"]; ?>" />
   </td>
 </tr>
 <tr>
    <td>Title:</td>
    <td>
      <?php
        $title = stripslashes($_GET["title"]);
        $title  =  htmlentities ($title, ENT_NOQUOTES);
      ?>
      <input type="text" id="delicious_title" name="delicious_title" style="width:218px;" value="<?php echo $title ?>" />
    </td>
  </tr>
  <tr>
    <td>Notes:</td>
    <td>
      <?php
        $notes = $_GET["text"];
      ?>
      <textarea style="width:218px;" id="delicious_notes" name="delicious_notes"><?php echo $notes; ?></textarea>
    </td>
  </tr>
  <tr>
    <td>Tags:</td>
    <td><input type="text" id="delicious_tags" name="delicious_tags" style="width:218px;" /></td>
  </tr>
<!---
  <tr>
    <td>Tweet:</td>
    <td><input type="text" id="delicious_tweet" name="delicious_tweet" style="width:218px;" /></td>
  </tr>
--->
  <tr>
    <td colspan="2"><input type="button" id="delicious_submit" value="Submit" style="width:70px;font-weight:bold; margin-right:75px; float:right" /></td>
  </tr>
  </table>
    </form>

    <div id="result" style="text-align:center"></div>
</body>
</html>
